package com.design.patterns.list.factory.absfactory.cola.ld;

import com.design.patterns.list.factory.absfactory.cola.Cola;
import com.design.patterns.list.factory.absfactory.cola.ColaFactory;

/**
 * @author Wangzhiwen
 */
public class LDColaFactory extends ColaFactory {
    @Override
    public Cola createCola(String colaName) {

        if ("ACola".equals(colaName)) return new ACola();

        if ("BCola".equals(colaName)) return new BCola();

        throw new RuntimeException("没有对于的LDCola");
    }
}
